package com.itboye.ihomebank.adapter;

import java.util.List;

import android.content.Context;
import android.content.Intent;
import android.view.View;
import android.view.View.OnClickListener;

import com.itboye.ihomebank.R;
import com.itboye.ihomebank.bean.ChanKanWeiXiuBean;
import com.itboye.ihomebank.me.ActivityPingJiaWorker;
import com.itboye.ihomebank.support.commonadapter.MutiplyCommonAdapter;
import com.itboye.ihomebank.support.commonadapter.ViewHolder;
/**
 * 我的生活管家（待评价）
 *
 */
public class MyGuanJiaAdapter03 extends MutiplyCommonAdapter<ChanKanWeiXiuBean>{
	List<ChanKanWeiXiuBean> datas;
	Context context;
	public MyGuanJiaAdapter03(Context context, List<ChanKanWeiXiuBean> datas,
			int... layoutId) {
		super(context, datas, layoutId);
		this.datas=datas;
		this.context=context;
	}

	@Override
	public int getItemViewType(int position) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public void getItemPosition(int position) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void convert(ViewHolder holder, final ChanKanWeiXiuBean t, int type,
			int position) {
		holder.setText(R.id.guanjia_danhao, t.getId());
		holder.setText(R.id.guanjia_leixing, t.getRepairstatus());
		holder.setText(R.id.guanjia_address, t.getAddress());
		holder.setText(R.id.guanjia_name, t.getUname());
		
		holder.setText(R.id.guanjia_01, "评价师傅");
		holder.setVisible(R.id.guanjia_02, false);
		
		holder.setOnClickListener(R.id.guanjia_01, position,new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				Intent intent=new Intent(context, ActivityPingJiaWorker.class);
				intent.putExtra("head", t.getHead());
				intent.putExtra("name", t.getWname());
				intent.putExtra("phone", t.getWmobile());
				intent.putExtra("wid", t.getWid());
				intent.putExtra("id", t.getId());
				context.startActivity(intent);
				
			}
		});
		
	}

}
